home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 9 / AMUG BBS in a Box Volume IX (August 1993) (MacWizards).iso / Files / Tele / M / MacBinary II+ 1.0.0.cpt / MacBinary II+ 1.0.0 / MacBinary II+ Prelim Spec < prev    next >
Encoding:
Text File  |  1993-02-09  |  4.3 KB  |  74 lines  |  [TEXT/ttxt]

  1. MacBinary II+ Preliminary Specification
  2.  
  3. This is a priliminary specification of an extension to the MacBinary II Standard to allow MacBinary to incorporate a directory tree in a similar way to a unix tar file.  This is done by a fairly simple extension to the standard (which is documented seperately, and which you should be familiar with before reading this), basically, I defined a 128 byte block that marks the start of a folder, and another one that marks the end of the folder, and then set it up like this:
  4.  
  5. start block for folder "Folder1"
  6.   file1 - standard macbinary format
  7.   file2
  8.   start block for "Folder2"
  9.     file3
  10.   end block
  11. end block
  12.  
  13. While the end block doesn't actually need to contain any information, its format is similar to the header block for consistency.
  14.  
  15. Start Block:
  16.   Offset 000-version 1 - this is incomptible with previous decoders.
  17.   Offset 001-Byte, Length of foldername (must be in the range 1-63)
  18.   Offset 002-1 to 63 chars, foldername (only "length" bytes are significant, 
  19.              the rest should be zero).
  20.   Offset 065-Long Word, file type - 'fold'
  21.   Offset 069-Long Word, file creator - $FFFFFFFF
  22.   Offset 073-Byte, original Finder flags of folder (high byte)
  23.   Offset 074-Byte, zero fill, must be zero for compatibility
  24.   Offset 075-Word, folder's vertical position within its window.
  25.   Offset 077-Word, folder's horizontal position within its window.
  26.   Offset 079-Word, folder's window or folder ID.
  27.   Offset 081-Byte, "Protected" flag (in low order bit).
  28.   Offset 082-Byte, zero fill, must be zero for compatibility
  29.   Offset 083-Long Word, Data Fork length 0
  30.   Offset 087-Long Word, Resource Fork length 0
  31.   Offset 091-Long Word, Folder's creation date
  32.   Offset 095-Long Word, Folder's "last modified" date.
  33.   Offset 099-Word, length of Get Info comment to be sent after the resource
  34.              fork (if implemented, see below).
  35.  *Offset 101-Byte, Finder Flags, bits 0-7. (Bits 8-15 are already in byte 73)
  36.  *Offset 116-Long Word, Length of total files when packed files are unpacked.
  37.              This may be zero to avoid having to preparse the folder when
  38.              creating the MacBinary file.
  39.  *Offset 120-Word, Length of a secondary header.  If this is non-zero,
  40.              Skip this many bytes (rounded up to the next multiple of 128)
  41.              This is for future expansion only, when sending files with
  42.              MacBinary, this word should be zero.
  43.  *Offset 122-Byte, Version number of Macbinary II - 130
  44.  *Offset 123-Byte, Minimum MacBinary II version needed to read this file - 130
  45.  *Offset 124-Word, CRC of previous 124 bytes
  46.  
  47. NOTE: The secondary header length MAY be non-zero, and if so, the secondary header immediately follows the Start Block, padded to a multiple of 128 bytes as usual.
  48.  
  49. NOTE: The comment length MAY be non-zero, and if so, the comment immediately follows the Start Block or secondary header, padded to a multiple of 128 bytes as usual.
  50.  
  51. End Block:
  52.   Offset 000-version 1 - this is incomptible with previous decoders.
  53.   Offset 065-Long Word, file type - 'fold'
  54.   Offset 069-Long Word, file creator - $FFFFFFFE
  55.  *Offset 116-Long Word, Length of total files when packed files are unpacked.
  56.              This may be zero.
  57.  *Offset 120-Word, Length of a secondary header.  If this is non-zero,
  58.              Skip this many bytes (rounded up to the next multiple of 128)
  59.              This is for future expansion only, when sending files with
  60.              MacBinary, this word should be zero.
  61.  *Offset 122-Byte, Version number of Macbinary II - 130
  62.  *Offset 123-Byte, Minimum MacBinary II version needed to read this file - 130
  63.  *Offset 124-Word, CRC of previous 124 bytes
  64.  
  65. NOTE: This block is static except for the total length field, which may be zero as well, in which case its totally static.
  66.  
  67. You should recognize the Start and End blocks by the version, file type and creator fields.  Decoders MUST NOT rely on ANY other fields in the End Block being valid.  Encoders MAY fill them out to look like a start block, or may zero-fill them.  Encoders SHOULD zero-fill any bytes not explicitly set - this applies to all header blocks and all padding.
  68.  
  69. All internal files should have version 0, MacBinary II version 129,129.
  70.  
  71. An extended MacBinary file MUST start with a Start Block.  Thus a MacBinary II+ file is either:
  72. 1) A MacBinary II file encoding a single file, OR
  73. 2) A MacBinary II+ file encoding a single folder.
  74.